{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport ConfigProvider, { ConfigContext } from '../config-provider';\n/* istanbul ignore next */\nexport default function genPurePanel(Component, defaultPrefixCls, getDropdownCls) {\n  return function PurePanel(props) {\n    var customizePrefixCls = props.prefixCls,\n      style = props.style;\n    var holderRef = React.useRef(null);\n    var _React$useState = React.useState(0),\n      _React$useState2 = _slicedToArray(_React$useState, 2),\n      popupHeight = _React$useState2[0],\n      setPopupHeight = _React$useState2[1];\n    var _React$useState3 = React.useState(0),\n      _React$useState4 = _slicedToArray(_React$useState3, 2),\n      popupWidth = _React$useState4[0],\n      setPopupWidth = _React$useState4[1];\n    var _useMergedState = useMergedState(false, {\n        value: props.open\n      }),\n      _useMergedState2 = _slicedToArray(_useMergedState, 2),\n      open = _useMergedState2[0],\n      setOpen = _useMergedState2[1];\n    var _React$useContext = React.useContext(ConfigContext),\n      getPrefixCls = _React$useContext.getPrefixCls;\n    var prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);\n    React.useEffect(function () {\n      // We do not care about ssr\n      setOpen(true);\n      if (typeof ResizeObserver !== 'undefined') {\n        var resizeObserver = new ResizeObserver(function (entries) {\n          var element = entries[0].target;\n          setPopupHeight(element.offsetHeight + 8);\n          setPopupWidth(element.offsetWidth);\n        });\n        var interval = setInterval(function () {\n          var _a;\n          var dropdownCls = getDropdownCls ? \".\".concat(getDropdownCls(prefixCls)) : \".\".concat(prefixCls, \"-dropdown\");\n          var popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);\n          if (popup) {\n            clearInterval(interval);\n            resizeObserver.observe(popup);\n          }\n        }, 10);\n        return function () {\n          clearInterval(interval);\n          resizeObserver.disconnect();\n        };\n      }\n    }, []);\n    return /*#__PURE__*/React.createElement(ConfigProvider, {\n      theme: {\n        token: {\n          motionDurationFast: '0.01s',\n          motionDurationMid: '0.01s',\n          motionDurationSlow: '0.01s'\n        }\n      }\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      ref: holderRef,\n      style: {\n        paddingBottom: popupHeight,\n        position: 'relative',\n        width: 'fit-content',\n        minWidth: popupWidth\n      }\n    }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {\n      style: Object.assign(Object.assign({}, style), {\n        margin: 0\n      }),\n      open: open,\n      visible: open,\n      getPopupContainer: function getPopupContainer() {\n        return holderRef.current;\n      }\n    }))));\n  };\n}","map":{"version":3,"names":["useMergedState","React","ConfigProvider","ConfigContext","genPurePanel","Component","defaultPrefixCls","getDropdownCls","PurePanel","props","customizePrefixCls","prefixCls","style","holderRef","useRef","useState","popupHeight","setPopupHeight","popupWidth","setPopupWidth","value","open","setOpen","useContext","getPrefixCls","useEffect","ResizeObserver","resizeObserver","entries","element","target","offsetHeight","offsetWidth","interval","setInterval","_a","dropdownCls","popup","current","querySelector","clearInterval","observe","disconnect","createElement","theme","token","motionDurationFast","motionDurationMid","motionDurationSlow","ref","paddingBottom","position","width","minWidth","Object","assign","margin","visible","getPopupContainer"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/_util/PurePanel.js"],"sourcesContent":["import useMergedState from \"rc-util/es/hooks/useMergedState\";\nimport * as React from 'react';\nimport ConfigProvider, { ConfigContext } from '../config-provider';\n/* istanbul ignore next */\nexport default function genPurePanel(Component, defaultPrefixCls, getDropdownCls) {\n  return function PurePanel(props) {\n    const {\n      prefixCls: customizePrefixCls,\n      style\n    } = props;\n    const holderRef = React.useRef(null);\n    const [popupHeight, setPopupHeight] = React.useState(0);\n    const [popupWidth, setPopupWidth] = React.useState(0);\n    const [open, setOpen] = useMergedState(false, {\n      value: props.open\n    });\n    const {\n      getPrefixCls\n    } = React.useContext(ConfigContext);\n    const prefixCls = getPrefixCls(defaultPrefixCls || 'select', customizePrefixCls);\n    React.useEffect(() => {\n      // We do not care about ssr\n      setOpen(true);\n      if (typeof ResizeObserver !== 'undefined') {\n        const resizeObserver = new ResizeObserver(entries => {\n          const element = entries[0].target;\n          setPopupHeight(element.offsetHeight + 8);\n          setPopupWidth(element.offsetWidth);\n        });\n        const interval = setInterval(() => {\n          var _a;\n          const dropdownCls = getDropdownCls ? `.${getDropdownCls(prefixCls)}` : `.${prefixCls}-dropdown`;\n          const popup = (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.querySelector(dropdownCls);\n          if (popup) {\n            clearInterval(interval);\n            resizeObserver.observe(popup);\n          }\n        }, 10);\n        return () => {\n          clearInterval(interval);\n          resizeObserver.disconnect();\n        };\n      }\n    }, []);\n    return /*#__PURE__*/React.createElement(ConfigProvider, {\n      theme: {\n        token: {\n          motionDurationFast: '0.01s',\n          motionDurationMid: '0.01s',\n          motionDurationSlow: '0.01s'\n        }\n      }\n    }, /*#__PURE__*/React.createElement(\"div\", {\n      ref: holderRef,\n      style: {\n        paddingBottom: popupHeight,\n        position: 'relative',\n        width: 'fit-content',\n        minWidth: popupWidth\n      }\n    }, /*#__PURE__*/React.createElement(Component, Object.assign({}, props, {\n      style: Object.assign(Object.assign({}, style), {\n        margin: 0\n      }),\n      open: open,\n      visible: open,\n      getPopupContainer: () => holderRef.current\n    }))));\n  };\n}"],"mappings":";AAAA,OAAOA,cAAc,MAAM,iCAAiC;AAC5D,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,cAAc,IAAIC,aAAa,QAAQ,oBAAoB;AAClE;AACA,eAAe,SAASC,YAAY,CAACC,SAAS,EAAEC,gBAAgB,EAAEC,cAAc,EAAE;EAChF,OAAO,SAASC,SAAS,CAACC,KAAK,EAAE;IAC/B,IACaC,kBAAkB,GAE3BD,KAAK,CAFPE,SAAS;MACTC,KAAK,GACHH,KAAK,CADPG,KAAK;IAEP,IAAMC,SAAS,GAAGZ,KAAK,CAACa,MAAM,CAAC,IAAI,CAAC;IACpC,sBAAsCb,KAAK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